finite difference method for solving partial differential equation